﻿
using MoreEPG.Helper;
namespace MoreEPG.Model
{
    
    /// <summary>
    /// A class to represent a Person (Actor, Director...)
    /// </summary>
    public class Person
    {
        private string _Uid;

        /// <summary>
        /// Unique ID
        /// </summary>
        public int id_ { get; set; }

        /// <summary>
        /// MC UID
        /// </summary>
        public string Uid
        {
            get
            {
                if (this._Uid == null)
                {
                    this.uid();
                }
                return this._Uid;
            }
            set
            {
                this._Uid = value;
            }
        }

        /// <summary>
        /// Name of the Person
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// Rolle (if Actor) of the Person
        /// </summary>
        public string Rolle { get; set; }

        /// <summary>
        /// Role of the Person
        /// </summary>
        public Roles Role { get; set; }

        /// <summary>
        /// Constructor for the Person Class
        /// </summary>
        /// <param name="id"></param>
        /// <param name="Name"></param>
        public Person(int id, string Name)
        {
            this.id_ = id;
            this.name = Name;
        }


        /// <summary>
        /// Get the id of the Person (MXF File)
        /// </summary>
        /// <returns>A string s#, to represent the channel</returns>
        public string id()
        {
            return "p" + id_.ToString();
        }

        /// <summary>
        /// set the UID
        /// </summary>
        /// <returns></returns>
        private void uid()
        {
            this._Uid = "!Person!" + this.name;
        }

    }
}
